<?php
/**
 * @author Amissah Gideon<kuulmek@yahoo.com>
 * @access public
 * @version 1.0
 */
?>
<!-- Main content -->
<section role="main" id="main">

    <!-- Header -->
    <?php echo $this->element('page_header'); ?>

    <div class="with-padding">
        <div class="columns">
            <div class="new-row-mobile twelve-columns six-columns-tablet twelve-columns-mobile">

                <h3 class="thin underline">Add, Edit and Delete Items</h3>

                <table id="flex" style="display:none;"></table>

                <div style="display: none;">
                    <div id="form-window" style="margin: 20px 5px 5px 5px;">
                        <div class="prompt" ></div>
                        <?php echo $this->Form->create('Item', array('default' => false, 'id' => 'form', 'action' => 'add','inputDefaults' => array('label' => false,'div' => false)));?>
                        <fieldset class="fieldset">
                            <legend class="legend">Info</legend>

                            <!--<p class="button-height inline-label">
                                <label class="label">Name:</label>
                                <?php /*echo $this->Form->input('name', array('id'=>'name', 'class' => 'select expandable-list validate[required] ', 'style'=>'width:170px;','options'=>$products, 'div' => false, 'label' => false,)); */?>
                            </p>-->

                            <p class="button-height inline-label">
                                <label class="label">Name:</label>
                                <?php echo $this->Form->input('name', array('id'=>'name', 'class' => 'input validate[required] ', 'style'=>'width:170px;','div' => false, 'label' => false,)); ?>
                            </p>

                            <p class="button-height inline-label">
                                <label class="label">Currency:</label>
                                <?php echo $this->Form->input('currency', array('id'=>'currency', 'class' => 'select validate[required] ', 'default'=>'$','options'=>$currency_opts, 'div' => false, 'label' => false,)); ?>
                            </p>
                            <p class="button-height inline-label">
                                <label class="label">Amount:</label>
                                <?php echo $this->Form->input('amount', array('id'=>'amount', 'class' => 'input validate[required,custom[number]]', 'type'=>'text' ,'value'=>'', 'div' => false, 'label' => false,)); ?>
                            </p>
                            <p class="button-height inline-label">
                                <label class="label">USD Conversion Rate:</label>
                                <?php echo $this->Form->input('usd_rate', array('type'=>'text','id'=>'usd_rate', 'class' => 'input validate[required] ', 'value'=>$buying_usd_rate,'div' => false, 'label' => false,)); ?>
                            </p>
                            <p class="button-height inline-label">
                                <label class="label">Insurance Currency:</label>
                                <?php echo $this->Form->input('insurance_currency', array('id'=>'insurance_currency', 'class' => 'select validate[required] ', 'default'=>'$','options'=>$currency_opts, 'div' => false, 'label' => false,)); ?>
                            </p>
                            <p class="button-height inline-label">
                                <label class="label">Insurance Amount:</label>
                                <?php echo $this->Form->input('insurance_amt', array('type'=>'text','id'=>'insurance_amt', 'class' => 'input validate[required] ', 'value'=>'0.00','div' => false, 'label' => false,)); ?>
                            </p>

                            <p class="button-height inline-label">
                                <label class="label">Specs:</label>
                                <?php echo $this->Form->input('specs', array('id'=>'specs', 'class' => '', 'div' => false, 'label' => false)); ?>
                            </p>

                            <p class="button-height inline-label">
                                <label class="label">Comments:</label>
                                <?php echo $this->Form->input('comments', array('id'=>'comments', 'class' => 'input full-width', 'div' => false, 'label' => false,)); ?>
                            </p>

                            <p class="button-height inline-label">
                                <label for="save-btn" class="label">&nbsp;</label>
                                <button type="submit" class="button" id="save-btn">
                                    <span class="button-icon green-gradient"><span class="icon-download"></span></span>
                                    Save
                                </button>

                                <button type="button" class="button" id="cancel-btn">
                                    <span class="button-icon anthracite-gradient"><span class="icon-cross-round"></span></span>
                                    Cancel
                                </button>
                            </p>
                        </fieldset>

                        <?php echo $this->Form->end();?>
                    </div>
                </div>

            </div>
        </div>
    </div>

</section>
<!-- End main content -->

<!-- Side tabs shortcuts -->
<?php echo $this->element('side_tabs_shortcuts'); ?>
<!-- Sidebar/drop-down menu -->
<?php echo $this->element('right_side_infos'); ?>


<!-- Users URL -->
<input type="hidden" id="table-url" value="<?php echo $this->Html->url(array('controller' => 'Items', 'action' => 'get')); ?>" />
<input type="hidden" id="add-edit-url" value="<?php echo $this->Html->url(array('controller' => 'Items', 'action' => 'add')); ?>" />
<input type="hidden" id="load-user-url" value="<?php echo $this->Html->url(array('controller' => 'Items', 'action' => 'load')); ?>" />
<input type="hidden" id="delete-url" value="<?php echo $this->Html->url(array('controller' => 'Items', 'action' => 'delete_')); ?>" />


<?php
echo $this->Html->script('setup.js');

/** Template functions **/
echo $this->Html->script('developr.input.js');
echo $this->Html->script('developr.message.js');
echo $this->Html->script('developr.modal.js');
echo $this->Html->script('developr.navigable.js');
echo $this->Html->script('developr.notify.js');
echo $this->Html->script('developr.scroll.js');
echo $this->Html->script('developr.progress-slider.js');
echo $this->Html->script('developr.tooltip.js');
echo $this->Html->script('developr.confirm.js');
echo $this->Html->script('developr.agenda.js');
echo $this->Html->script('developr.tabs.js');
echo $this->Html->script('libs/CLEditor/jquery.cleditor.min.js');

echo $this->Html->script('libs/tinycon.min.js');
echo $this->Html->script('jquery.thfloat-0.3.min.js');
echo $this->Html->script('custom-scripts/items.js');
?>